<template>
	<view>
		<view>
			<!-- <view style="width: 100%; height: 80px; background-color: beige;">
			<view class="touxiang"></view>
			<button class=""></button>
		</view>
		<button class="button1">订单管理</button>
		<button class="button2">投诉建议</button>
		<button class="button3">关于我们</button> -->

			<view :class="theme">
				<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
					<image class="avatar" :src="avatarUrl"></image>
				</button>

				<view style="display: flex;">
					<text style="margin-left: 2%;">昵称</text>
					<input style="margin-left: 10%;" type="nickname" class="weui-input" placeholder="请输入昵称" />
				</view>
			</view>

			<!-- <view class="user_img" v-if="userInfo.avatarUrl">
				<image class="user_bg" :src="userInfo.avatarUrl"></image>
				<view class="user_info">
					<image class="user_icon" :src="userInfo.avatarUrl"></image>
					<view class="user_name">{{userInfo.nickName}}</view>
				</view>
			</view> -->
			<!-- <view class="denglu" >
				<image class="img" src=""></image>
				<button type="primary" lang="zh_CN" @tap="getUserProfile">登录</button>
			</view> -->
		</view>

		<view class="other">

			<view class="other_item">
				<navigator url="../dingdan/dingdan">订单管理</navigator>

			</view>

			<view class="other_item">
				<navigator url="/pages/feedback/feedback">意见反馈</navigator>
			</view>

			<view class="other_item">
				<navigator url="/pages/about/about">关于我们</navigator>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			const defaultAvatarUrl =
				'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
			return {
				userInfo: {},
				avatarUrl: defaultAvatarUrl,
				theme: wx.getSystemInfoSync().theme,
			}
		},
		onLoad() {
			wx.onThemeChange((result) => {
				this.theme = result.theme
			})
		},
		methods: {

			onChooseAvatar(e) {
				console.log(e.detail);
				this.avatarUrl = e.detail.avatarUrl
			},
			//微信登录
			getUserProfile(e) {
				uni.getUserProfile({
					lang: 'zh_CN',
					desc: '用于获取个人资料',
					success: (res) => {
						console.log(res.userInfo);
						this.userInfo = res.userInfo
					}
				})
			}
		}
	}
</script>

<style>
	.avatar-wrapper {
		padding: 0;
		width: 56px !important;
		border-radius: 8px;
		margin-top: 40px;
		margin-bottom: 40px;
	}

	.avatar {
		display: block;
		width: 56px;
		height: 56px;
	}

	.container {
		display: flex;
	}

	.denglu {
		left: 30%;
		justify-content: center;
		/* display: flex; */
	}

	.user_img {
		left: 30%;
		display: flex;
		/* height: 200px;
		width: 200px; */

	}

	.touxiang {
		width: 60px;
		height: 60px;
		background-color: aqua;
		padding-left: 10px;
		padding-top: 10px;
	}

	.anniu {}

	.button1 {
		margin-top: 200rpx;
		width: 300px;
	}

	.button2 {
		width: 300px;
	}

	.button3 {
		width: 300px;
	}

	.user_info_wrap {
		height: 50vh;
	}

	.user_bg {
		height: 50vh;
		width: 100%;
		filter: blur(10rpx);
	}

	.user_info {
		position: absolute;
		left: 50%;
		transform: translate(-50%);
		top: 10%;
		text-align: center;
		margin-top: 30rpx;
	}

	.user_icon {
		width: 150rpx;
		height: 150rpx;
		border-radius: 50%;
	}

	.user_name {
		color: #000000;
		margin-top: 40rpx;
		font-size: 40rpx;
	}

	.user_btn {
		position: absolute;
		left: 50%;
		transform: translate(-50%);
		top: 30%;
		border: 1rpx solid greenyellow;
		color: greenyellow;
		font-size: 38rpx;
		padding: 30rpx;

	}

	.img {
		width: 100%;
		height: 500rpx;
	}

	.other_item {
		margin-top: 30rpx;
		background-color: #fff;
		padding: 20rpx;
		border-bottom: 1rpx solid #ccc;
	}
</style>
